import request from '@/utils/request'

const baseUrl = 'http://student.daxigua.com/api'
export default {
    searchStudent(pageNum, pageSize, keyWord) {
        return request({
            url: `${baseUrl}/student/search/${pageNum}/${pageSize}`,
            method: 'post',
            data: keyWord
        })
    },

    findStudentById(sid) {
        return request({
            url: `${baseUrl}/student/getById/${sid}`,
            method: 'get'
        })
    },

    addStudent(student) {
        return request({
            url: `${baseUrl}/student/add`,
            method: 'post',
            data: student
        })
    },

    updateStudent(student) {
        return request({
            url: `${baseUrl}/student/update`,
            method: 'put',
            data: student
        })
    },

    removeStudents(ids) {
        return request({
            url: `${baseUrl}/student/remove`,
            method: 'delete',
            data: ids
        })
    }
}